// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_b.p_b.p_h;

import android.os.Bundle;
import com.nnee.p_b.p_b.p_e.cls_f;
import com.nnee.p_b.p_b.p_e.cls_j;
import com.nnee.p_b.p_b.p_e.cls_k;
import com.nnee.p_c.p_b.cls_d;
import com.nnee.p_fk.p_a.cls_m;
import com.nnee.p_fk.p_b.cls_c;
import com.nnee.p_pr.p_c.cls_l;
import java.net.URLDecoder;
import org.json.JSONException;
import org.json.JSONObject;

// Referenced classes of package com.nnee.b.b.h:
//            d, a

public class cls_b extends cls_k
{

    public cls_b()
    {
        super(4096);
        a = 1;
        a = 2;
    }

    private cls_j b(String s)
    {
        cls_j j1 = new cls_j(7);
        com.nnee.p_g.cls_b.e("kaixin", s);
        try
        {
            JSONObject jsonobject = new JSONObject(s);
            j1.d(com.nnee.p_c.cls_b.c(jsonobject.optString("name")));
            j1.e(com.nnee.p_c.cls_b.c(jsonobject.optString("uid")));
            j1.g((new StringBuilder()).append("http://www.kaixin001.com/home/?uid=").append(j1.f()).toString());
            j1.f(com.nnee.p_c.cls_b.c(jsonobject.optString("logo50")));
        }
        catch(JSONException jsonexception)
        {
            j1 = null;
            jsonexception.printStackTrace();
        }
        return j1;
    }

    private cls_m b()
    {
        cls_j j1 = new cls_j(7);
        j1.a(1);
        c(0, j1);
        String s = com.nnee.p_b.p_b.p_h.cls_d.a().a("/oauth/request_token");
        return com.nnee.p_b.p_b.p_h.cls_d.a().b().a(com.nnee.p_fk.p_a.cls_b.aGET, s, null);
    }

    private cls_m c(String s)
    {
        cls_j j1 = new cls_j(7);
        j1.a(3);
        c(0, j1);
        StringBuffer stringbuffer = new StringBuffer(com.nnee.p_b.p_b.p_h.cls_d.a().b("/oauth2/access_token"));
        stringbuffer.append("?");
        Bundle bundle = new Bundle();
        bundle.putString("grant_type", "authorization_code");
        bundle.putString("client_id", "248858130998b36ac5d42c42b05caa96");
        bundle.putString("client_secret", "b759b840c0971dbd5fb3af77ec7c39c4");
        if(s != null)
            bundle.putString("code", s);
        bundle.putString("redirect_uri", "http://yuedu.163.com/redirect_uri");
        stringbuffer.append(com.nnee.p_b.p_b.p_h.cls_d.a(bundle));
        return new cls_m(stringbuffer.toString(), com.nnee.p_fk.p_a.cls_b.aGET);
    }

    private cls_m f()
    {
        StringBuffer stringbuffer = new StringBuffer(com.nnee.p_b.p_b.p_h.cls_d.a().a("/oauth2/authorize"));
        stringbuffer.append("?");
        Bundle bundle = new Bundle();
        bundle.putString("client_id", "248858130998b36ac5d42c42b05caa96");
        bundle.putString("redirect_uri", "http://yuedu.163.com/redirect_uri");
        bundle.putString("response_type", "code");
        bundle.putString("scope", "basic create_records");
        stringbuffer.append(com.nnee.p_b.p_b.p_h.cls_d.a(bundle));
        cls_j j1 = new cls_j(7);
        j1.getClass();
        j1.a(new cls_a(this, j1, stringbuffer.toString(), "http://yuedu.163.com/redirect_uri"));
        j1.a(2);
        c(0, j1);
        return null;
    }

    public cls_m a()
    {
        cls_j j1 = new cls_j(7);
        j1.a(4);
        c(0, j1);
        StringBuffer stringbuffer = new StringBuffer(com.nnee.p_b.p_b.p_h.cls_d.a().b("/users/me.json"));
        stringbuffer.append("?");
        Bundle bundle = new Bundle();
        bundle.putString("access_token", URLDecoder.decode(com.nnee.p_b.p_b.p_h.cls_d.a().b().d));
        stringbuffer.append(com.nnee.p_b.p_b.p_h.cls_d.a(bundle));
        return new cls_m(stringbuffer.toString(), com.nnee.p_fk.p_a.cls_b.aGET);
    }

    protected void a(int i, Object obj)
    {
        super.a(i, obj);
        if(a != 5)
            g().a(this);
        else
            h();
    }

    public void a(int i, String s)
    {
        cls_f f1 = com.nnee.p_b.p_b.p_h.cls_d.a().c(s);
        d(f1.h, f1);
    }

    public void a(String s)
    {
//        com.nnee.p_g.cls_b.e("LoninTransaction", s);
//        a;
//        JVM INSTR tableswitch 1 4: default 40
//    //                   1 41
//    //                   2 40
//    //                   3 41
//    //                   4 113;
//           goto _L1 _L2 _L1 _L2 _L3
//_L1:
//        return;
//_L2:
//        a = 1 + a;
//        try
//        {
//            String s3 = (new JSONObject(s)).optString("access_token");
//            d.a().a(s3, "null");
//        }
//        catch(Exception exception)
//        {
//            exception.printStackTrace();
//            d(-1, new cls_f(7, -1, null, null));
//            a = 5;
//        }
//        continue; /* Loop/switch isn't completed */
//_L3:
//        a = 1 + a;
//        cls_j j1 = b(s);
//        if(j1 != null)
//        {
//            com.nnee.p_g.cls_b.e("LoninTransaction", (new StringBuilder()).append(j1.e()).append("|").append(j1.f()).append("|").append(j1.h()).toString());
//            String s1 = d.a().b().d;
//            String s2 = d.a().b().e;
//            com.nnee.p_pr.p_c.cls_l.a(com.nnee.p_b.p_a.cls_d.h().a(), j1.e(), 7, s1, s2, j1.g(), j1.h(), j1.b());
//            j1.a(5);
//            c(0, j1);
//        } else
//        {
//            d(-1, new cls_f(7, -1, null, null));
//        }
//        if(true) goto _L1; else goto _L4
//_L4:
    }

    public void c()
    {
//        cls_m m1;
//        com.nnee.p_g.cls_b.e("LoninTransaction", (new StringBuilder()).append("").append(a).toString());
//        m1 = null;
//        a;
//        JVM INSTR tableswitch 1 4: default 64
//    //                   1 81
//    //                   2 89
//    //                   3 97
//    //                   4 109;
//           goto _L1 _L2 _L3 _L4 _L5
//_L1:
//        break; /* Loop/switch isn't completed */
//_L5:
//        break MISSING_BLOCK_LABEL_109;
//_L6:
//        if(!o() && m1 != null)
//            a(m1);
//        else
//        if(a != 2)
//            h();
//        return;
//_L2:
//        m1 = b();
//          goto _L6
//_L3:
//        m1 = f();
//          goto _L6
//_L4:
//        m1 = c(b);
//          goto _L6
//        m1 = a();
//          goto _L6
    }

    private static final String j = "/oauth/request_token";
    private static final String k = "/oauth2/authorize";
    private static final String l = "/oauth2/access_token";
    private static final int m = 1;
    private static final int n = 2;
    private static final int o = 3;
    private static final int p = 4;
    private static final int q = 5;
    int a;
    String b;
}
